From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0002.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0002.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0002.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0002.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0002.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0002.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0002.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0002.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0002.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0002.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0002.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0002.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0002.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0002.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0003.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0003.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0003.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0003.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0003.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0003.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0003.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0003.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0003.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0003.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0003.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0003.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0003.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0003.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0004.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0004.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0004.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0004.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0004.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0004.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0004.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0004.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0004.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0004.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0004.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0004.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0004.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0004.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0005.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0005.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0005.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0005.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0005.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0005.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0005.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0005.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0005.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0005.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0005.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0005.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0005.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0005.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0006.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0006.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0006.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0006.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0006.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0006.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0006.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0006.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0006.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0006.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0006.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0006.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0006.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0006.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0007.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0007.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0007.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0007.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0007.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0007.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0007.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0007.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0007.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0007.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0007.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0007.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0007.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0007.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0008.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0008.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0008.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0008.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5b23dcf/attachment-0008.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0008.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0008.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/35ed183e/attachment-0008.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0008.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0008.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0008.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0008.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0008.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0008.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0009.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0009.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0009.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0009.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0009.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0009.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0009.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0009.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0009.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0009.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0009.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0009.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0010.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0010.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0010.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0010.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0001.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0010.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0010.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0001.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0010.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0010.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0010.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0010.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0010.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0010.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0011.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0011.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0011.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0011.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0002.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0011.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0011.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0002.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0011.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0011.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0011.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0011.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0011.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0011.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0012.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0012.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0012.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0012.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0003.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0012.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0012.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0003.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0012.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0012.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0012.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0012.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0012.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0012.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0013.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0013.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0013.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0013.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0004.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0013.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0013.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0004.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0013.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0013.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0013.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0013.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0013.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0013.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0014.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0014.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0014.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0014.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0005.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0014.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0014.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0005.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0014.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0014.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0014.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0014.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0014.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0014.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0015.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0015.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0015.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0015.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0006.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0015.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0015.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0006.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0015.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0015.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0015.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0015.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0015.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0015.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0016.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0016.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0016.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0016.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0007.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0016.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0016.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0007.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0016.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0016.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0016.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0016.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0016.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0016.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0017.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0017.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0017.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0017.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0008.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0017.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0017.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0008.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0017.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0017.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0017.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0017.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0017.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0017.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0018.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0018.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0018.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0018.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0009.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0018.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0018.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0009.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0018.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0018.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0018.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0018.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0018.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0018.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0019.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0019.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0019.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0019.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0010.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0019.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0019.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0010.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0019.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0019.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0019.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0019.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0019.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0019.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0020.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0020.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0020.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0020.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0011.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0020.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0020.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0011.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0020.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0020.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0020.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0020.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0020.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0020.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0021.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0021.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0021.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0021.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0012.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0021.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0021.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0012.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0021.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0021.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0021.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0021.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0021.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0021.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0022.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0022.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0022.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0022.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0013.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0022.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0022.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0013.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0022.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0022.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0022.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0022.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0022.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0022.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0023.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0023.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0023.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0023.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0014.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0023.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0023.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0014.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0023.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0023.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0023.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0023.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0023.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0023.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0024.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0024.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0024.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0024.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0015.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0024.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0024.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0015.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0024.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0024.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0024.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0024.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0024.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0024.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0025.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0025.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0025.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0025.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0016.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0025.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0025.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0016.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0025.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0025.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0025.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0025.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0025.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0025.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0026.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0026.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0026.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0026.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0017.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0026.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0026.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0017.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0026.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0026.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0026.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0026.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0026.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0026.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0027.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0027.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0027.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0027.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0018.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0027.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0027.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0018.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0027.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0027.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0027.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0027.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0027.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0027.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0028.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0028.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0028.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0028.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0019.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0028.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0028.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0019.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0028.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0028.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0028.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0028.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0028.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0028.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0029.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0029.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0029.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0029.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0020.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0029.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0029.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0020.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0029.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0029.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0029.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0029.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0029.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0029.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0030.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0030.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0030.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0030.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0021.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0030.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0030.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0021.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0030.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0030.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0030.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0030.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0030.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0030.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0031.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0031.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0031.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam@somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0031.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0022.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/libraries_on_classpath_fixed-0031.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0031.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka@exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0022.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0031.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0031.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0031.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/SerialImp-0031.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/RXTXCommDriver-0031.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/SerialImp-0031.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0032.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0032.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0032.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0032.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0023.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0032.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0023.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0032.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0032.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0032.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0033.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0033.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0033.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0033.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0024.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0001.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0033.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0024.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0033.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0033.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0033.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0001.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0001.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0001.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0034.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0034.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0034.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0034.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0025.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0002.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0034.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0025.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0034.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0034.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0034.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0002.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0002.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0002.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0035.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0035.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0035.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0035.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0026.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0003.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0035.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0026.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0035.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0035.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0035.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0003.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0003.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0003.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0036.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0036.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0036.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0036.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0027.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0004.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0036.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0027.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0036.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0036.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0036.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0004.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0004.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0004.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0037.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0037.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0037.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0037.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0028.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0005.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0037.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0028.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0037.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0037.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0037.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0005.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0005.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0005.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0038.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0038.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0038.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0038.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0029.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0006.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0038.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0029.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0038.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0038.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0038.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0006.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0006.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0006.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0039.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0039.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0039.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0039.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0030.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0007.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0039.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0030.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0039.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0039.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0039.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0007.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0007.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0007.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0040.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0040.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0040.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0040.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0031.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0008.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0040.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0031.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0040.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0040.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0040.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0008.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0008.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0008.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0041.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0041.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0041.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0041.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0032.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0009.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0041.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0032.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0041.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0041.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0041.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0009.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0009.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0009.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0042.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0042.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0042.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0042.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0033.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0010.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0042.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0033.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0042.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0042.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0042.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0010.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0010.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0010.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0043.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0043.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0043.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0043.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0034.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0011.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0043.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0034.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0043.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0043.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0043.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0011.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0011.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0011.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0044.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0044.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for flags to pass gcc 4.0 to make the native libraries more backwards compatible but only found options for C++ which is not used in rxtx. I've got a list of other bugs that I'll be going through in the next few weeks but for now I just left them with the same CVS filename - no code changes. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-CVS-20050120-bins.tar.gz -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Tue Apr 5 02:24:33 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue, 05 Apr 2005 09:24:33 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: References: <42515A83.4050907@emation.pt> Message-ID: <42524B41.3040300@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050405/5919abbb/attachment-0044.html From taj at www.linux.org.uk Tue Apr 5 03:00:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 10:00:29 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42524B41.3040300@emation.pt> References: <42515A83.4050907@emation.pt> <42524B41.3040300@emation.pt> Message-ID: On Tue, 5 Apr 2005, Ricardo Trindade wrote: > Will you anounce to the list when a new release is available ? > There will be several incremental releases announced here. Once those are done, we will release 2.1.7 and 2.0.7. -- Trent Jarvi taj at www.linux.org.uk From no_spam at somewhere.com Tue Apr 5 11:55:37 2005 From: no_spam at somewhere.com (no_spam at somewhere.com) Date: Tue, 5 Apr 2005 13:55:37 -0400 Subject: [Rxtx] Closing a port from an event listener results in a deadlock Message-ID: <20050405175537.GA21747@rcog.homelinux.net> On the message I sent on March 14, does anyone had the chance to try the modification? Or was it already fixed? (I haven't searched the archive extensively) Or maybe my message got catched by some spam filters? (it made it to the list archive though) Anyway, I would appreciate some feedback (through the list) Thanks From taj at www.linux.org.uk Tue Apr 5 14:42:28 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 21:42:28 +0100 (BST) Subject: [Rxtx] Closing a port from an event listener results in a deadlock In-Reply-To: <20050405175537.GA21747@rcog.homelinux.net> References: <20050405175537.GA21747@rcog.homelinux.net> Message-ID: On Tue, 5 Apr 2005 no_spam at somewhere.com wrote: > On the message I sent on March 14, does anyone had the chance to try the > modification? > > Or was it already fixed? (I haven't searched the archive extensively) > > Or maybe my message got catched by some spam filters? (it made it to the list > archive though) > > Anyway, I would appreciate some feedback (through the list) > The patch is here http://marc.theaimsgroup.com/?l=rxtx&m=111084488820288&w=2 I have applied this patch to a local copy but will not be doing formal testing for a couple weeks. I do not try to close ports from inside the eventListenter usually so I encourage any feedback also. If there are no problems reported, I expect this will go into rxtx 2.1-7. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 6 08:33:42 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 06 Apr 2005 15:33:42 +0100 Subject: [Rxtx] getting RXTX version Message-ID: <4253F346.50102@emation.pt> Hi, I want to make sure my deployments have the same version of RXTX jar and native lib. I know the version of the jar can be obtained in the Version class, but how can I obtain the native version ? I know RXTX prints to the console a warning if the version is different. Is there a way to programatically know is this is the case ? I would like to log that to our app's log thanks Ricardo From taj at www.linux.org.uk Wed Apr 6 15:10:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 6 Apr 2005 22:10:20 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4253F346.50102@emation.pt> References: <4253F346.50102@emation.pt> Message-ID: On Wed, 6 Apr 2005, Ricardo Trindade wrote: > Hi, > > I want to make sure my deployments have the same version of RXTX jar > and native lib. > > I know the version of the jar can be obtained in the Version class, > but how can I obtain the native version ? > > I know RXTX prints to the console a warning if the version is > different. Is there a way to programatically know is this is the case ? > > I would like to log that to our app's log > There isn't a suggested way of doing that right now. We could move things around and have a static String RXTXVersion.getNativeVersion() in future releases. Is this what you expected? This is not documented in commapi at all. I just tossed that in to catch conflicts while developing. It would be nice to have access in GUI applications though. It may be possible to access RXTXCommDriver.LibVersion right now. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Thu Apr 7 02:51:00 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 09:51:00 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> Message-ID: <4254F474.7020905@emation.pt> >There isn't a suggested way of doing that right now. We could move things >around and have a static String RXTXVersion.getNativeVersion() in future >releases. Is this what you expected? > > Yes, that would be perfect. >This is not documented in commapi at all. I just tossed that in to catch >conflicts while developing. It would be nice to have access in GUI >applications though. > >It may be possible to access RXTXCommDriver.LibVersion right now. > > > I tried, and I don't think it's possible. From taj at www.linux.org.uk Thu Apr 7 03:32:04 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 7 Apr 2005 10:32:04 +0100 (BST) Subject: [Rxtx] getting RXTX version In-Reply-To: <4254F474.7020905@emation.pt> References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: On Thu, 7 Apr 2005, Ricardo Trindade wrote: > > >There isn't a suggested way of doing that right now. We could move things > >around and have a static String RXTXVersion.getNativeVersion() in future > >releases. Is this what you expected? > > > > > > Yes, that would be perfect. > The attached should do what you want. You will still need to catch an exception for older versions... -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- ? public_version.patch Index: RXTXCommDriver.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXCommDriver.java,v retrieving revision 1.16.2.51 diff -u -r1.16.2.51 RXTXCommDriver.java --- RXTXCommDriver.java 12 Oct 2004 09:13:30 -0000 1.16.2.51 +++ RXTXCommDriver.java 7 Apr 2005 09:29:04 -0000 @@ -54,7 +54,7 @@ the Library. */ String JarVersion = RXTXVersion.getVersion(); - String LibVersion = nativeGetVersion(); + String LibVersion = RXTXVersion.nativeGetVersion(); if ( devel ) { System.out.println("Devel Library"); @@ -76,7 +76,6 @@ /** Get the Serial port prefixes for the running OS */ private String deviceDirectory; private String osName; - private static native String nativeGetVersion(); private native boolean registerKnownPorts(int PortType); private native boolean isPortPrefixValid(String dev); private native boolean testRead(String dev, int type); Index: RXTXVersion.java =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/RXTXVersion.java,v retrieving revision 1.2.2.31 diff -u -r1.2.2.31 RXTXVersion.java --- RXTXVersion.java 16 Oct 2004 16:20:35 -0000 1.2.2.31 +++ RXTXVersion.java 7 Apr 2005 09:29:04 -0000 @@ -36,6 +36,7 @@ private static String Version; static { + System.loadLibrary( "rxtxSerial" ); Version = "RXTX-2.1-7pre20"; } /** @@ -47,4 +48,5 @@ { return(Version); } + public static native String nativeGetVersion(); } Index: SerialImp.c =================================================================== RCS file: /usr/local/cvsroot/rxtx-devel/src/SerialImp.c,v retrieving revision 1.46.2.181 diff -u -r1.46.2.181 SerialImp.c --- SerialImp.c 17 Oct 2004 09:48:56 -0000 1.46.2.181 +++ SerialImp.c 7 Apr 2005 09:29:07 -0000 @@ -116,6 +116,7 @@ * It will eventually be removed. * */ #define RXTXPort(foo) Java_gnu_io_RXTXPort_ ## foo +#define RXTXVersion(foo) Java_gnu_io_RXTXVersion_ ## foo #define RXTXCommDriver(foo) Java_gnu_io_RXTXCommDriver_ ## foo #if defined(__sun__) || defined(__hpux__) @@ -4001,7 +4002,7 @@ } /*---------------------------------------------------------- -RXTXCommDriver.nativeGetVersion +RXTXVersion.nativeGetVersion accept: none perform: return the current version @@ -4010,9 +4011,10 @@ comments: This is used to avoid mixing versions of the .jar and native library. First introduced in rxtx-1.5-9 + Moved from RXTXCommDriver to RXTXVersion in rxtx-2.1-7 ----------------------------------------------------------*/ -JNIEXPORT jstring JNICALL RXTXCommDriver(nativeGetVersion) (JNIEnv *env, +JNIEXPORT jstring JNICALL RXTXVersion(nativeGetVersion) (JNIEnv *env, jclass jclazz ) { return (*env)->NewStringUTF( env, "RXTX-2.1-7pre20" ); From ricardo.trindade at emation.pt Thu Apr 7 03:45:58 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Thu, 07 Apr 2005 10:45:58 +0100 Subject: [Rxtx] getting RXTX version In-Reply-To: References: <4253F346.50102@emation.pt> <4254F474.7020905@emation.pt> Message-ID: <42550156.2040908@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/05212451/attachment-0044.html From thomas.shulok at lmco.com Thu Apr 7 17:43:11 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Thu, 07 Apr 2005 19:43:11 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi There, I'm attempting to talk RS232 between an embedded Linux box and a Windows box. Everything connects up fine, and I can send and receive a simple sequence of bytes with no problems. However, if around 5 seconds goes by without me sending something, I get the following when I attempt to send. java.io.IOException: Input/output error in writeArray Stack trace: java/lang/Throwable.()V java/lang/Throwable.(Ljava/lang/String;)V java/io/IOException.(Ljava/lang/String;)V gnu/io/RXTXPort.writeArray([BIIZ)V gnu/io/RXTXPort$SerialOutputStream.write([B)V SerialTest.main([Ljava/lang/String;)V If there interval is shorter (say 2 seconds between sends), I have no problems. On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and librxtxSerial-2.0.7pre2.so. Any ideas? Thanks, Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050407/d5b23dcf/attachment-0035.html From taj at www.linux.org.uk Thu Apr 7 19:22:36 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:22:36 +0100 (BST) Subject: [Rxtx] Input/output error in writeArray In-Reply-To: References: Message-ID: On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a Windows > box. Everything connects up fine, and I can send and receive a simple > sequence of bytes with no problems. However, if around 5 seconds goes > by without me sending something, I get the following when I attempt to > send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 7 19:24:59 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 8 Apr 2005 02:24:59 +0100 (BST) Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) Message-ID: hmm. This would not work from applets would it? -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Thu, 07 Apr 2005 16:05:53 -0400 From: Chris Gaffney To: taj at www.linux.org.uk Subject: RXTX Libraries on Classpath fix Hi, I submitted a patch for RXTX a few weeks ago to allow for loading the native libraries from the classpath. Since sending it to you I found it wasn't working on windows. I've fixed the problem and created a new patch that should replace the older one. The actual change is a one line from a String.equals() to a String.startsWith(). Thanks for a great piece of software, -Chris Gaffney Grand Valley State University -------------- next part -------------- A non-text attachment was scrubbed... Name: libraries_on_classpath_fixed.patch Type: text/x-patch Size: 5617 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050408/d5d423b8/attachment-0012.bin From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From dmarkman at mac.com Fri Apr 8 09:43:31 2005 From: dmarkman at mac.com (Dmitry Markman) Date: Fri, 8 Apr 2005 11:43:31 -0400 Subject: [Rxtx] RXTX Libraries on Classpath fix (fwd) In-Reply-To: References: Message-ID: <65b73d29e98d99e3dce95d6b707d8a20@mac.com> I think if RXTX is pre-installed it will work from applet (that could be a problem that dylib couldn't be unloaded on mac os x) On Apr 7, 2005, at 9:24 PM, Java RXTX discussion wrote: > > > hmm. ?This would not work from applets would it? > > > -- > Trent Jarvi > taj at www.linux.org.uk > > > ---------- Forwarded message ---------- > Date: Thu, 07 Apr 2005 16:05:53 -0400 > From: Chris Gaffney > To: taj at www.linux.org.uk > Subject: RXTX Libraries on Classpath fix > > > Hi, > > > I submitted a patch for RXTX a few weeks ago to allow for loading the > native libraries from the classpath. Since sending it to you I found > it > wasn't working on windows. I've fixed the problem and created a new > patch that should replace the older one. The actual change is a one > line > from a String.equals() to a String.startsWith(). > > > Thanks for a great piece of software, > -Chris Gaffney > Grand Valley State University > diff -Naur rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java > rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java > > > --- rxtx-2.1-7pre17-orig/src/CommPortIdentifier.java????2003-02-18 > 06:51:20.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/CommPortIdentifier.java?????2005-02-26 > 13:35:02.000000000 -0500 > > > @@ -80,7 +80,7 @@ > > > ??????????????????????if (debug) > > > ?????????????????????????????System.out.println("Have not implemented > native_psmisc_report_owner(PortName)); in CommPortIdentifier"); > > > ???????????????} > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ????????} > > > ????????CommPortIdentifier ( String pn, CommPort cp, int pt, > CommDriver driver) > > > ????????{ > > > diff -Naur rxtx-2.1-7pre17-orig/src/I2C.java > rxtx-2.1-7pre17-mod/src/I2C.java > > > --- rxtx-2.1-7pre17-orig/src/I2C.java???2002-04-05 12:05:15.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/I2C.java????2005-02-26 13:27:16.000000000 > -0500 > > > @@ -35,7 +35,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxI2C" ); > > > +??????????????LibLoader.loadLibrary( "rxtxI2C" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LPRPort.java > rxtx-2.1-7pre17-mod/src/LPRPort.java > > > --- rxtx-2.1-7pre17-orig/src/LPRPort.java???????2002-11-25 > 16:57:42.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LPRPort.java????????2005-02-26 > 13:27:55.000000000 -0500 > > > @@ -32,7 +32,7 @@ > > > ?{ > > > ? > > > ????????static { > > > -??????????????System.loadLibrary( "rxtxParallel" ); > > > +??????????????LibLoader.loadLibrary( "rxtxParallel" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/LibLoader.java > rxtx-2.1-7pre17-mod/src/LibLoader.java > > > --- rxtx-2.1-7pre17-orig/src/LibLoader.java?????1969-12-31 > 19:00:00.000000000 -0500 > > > +++ rxtx-2.1-7pre17-mod/src/LibLoader.java??????2005-04-07 > 15:53:08.000000000 -0400 > > > @@ -0,0 +1,68 @@ > > > +/* > > > + * LibLoader.java > > > + * > > > + * Created on February 26, 2005, 1:03 PM > > > + */ > > > + > > > +package gnu.io; > > > + > > > +import java.net.URL; > > > +import java.util.HashSet; > > > +import java.util.Locale; > > > +import java.util.Set; > > > + > > > +/** > > > + * Package specific class for allowing the loading of libraries from > the > > > + * classpath. This class uses some RXTX specific conventions so it > would require > > > + * some modifications for use in other software. > > > + * @author Chris Gaffney > > > + */ > > > +class LibLoader { > > > + ???/** Set of loaded libaries. */ > > > + ???private static final Set loaded = new HashSet(); > > > + ??? > > > + ???/** This is a static class so lets not let it be instantiated. */ > > > + ???private LibLoader() {} > > > + ??? > > > + ???public static void loadLibrary(String lib) { > > > + ???????if(loaded.contains(lib)) { > > > + ???????????// Library is already loaded so just exit. > > > + ???????????return; > > > + ???????} > > > + ??????? > > > + ???????// Lets try to load the library. > > > + ???????try { > > > + ???????????// Try to load the library through regular channels. > > > + ???????????System.loadLibrary(lib); > > > + ???????} catch (UnsatisfiedLinkError e) { > > > + ???????????// Load has failed so we attempt to locate the library > > > + ???????????// on the classpath > > > + ???????????String fileName = lib + "."; > > > + ??????????? > > > + ???????????String os = > System.getProperty("os.name").toLowerCase(Locale.US); > > > + ???????????if(os.startsWith("windows")) { > > > + ???????????????// Windows. > > > + ???????????????fileName += "dll"; > > > + ???????????} else { > > > + ???????????????fileName = "lib" + fileName + "so"; > > > + ???????????} > > > + ??????????? > > > + ???????????URL libURL = ClassLoader.getSystemResource(fileName); > > > + ???????????//URL libURL = > getClass().getClassLoader().getResource(fileName); > > > + ??????????? > > > + ???????????if(libURL == null) { > > > + ???????????????// If we couldn't find it on the classpath so throw > the original > > > + ???????????????// exception. > > > + ???????????????throw e; > > > + ???????????} else { > > > + ???????????????// File exists so lets load it. If it fails then we > just let the > > > + ???????????????// exception be thrown to the parent class. > > > + ???????????????System.load(libURL.getFile()); > > > + ???????????} > > > + ???????} > > > + ??????? > > > + ???????// If we made it here then everything went well so mark the > library as > > > + ???????// loaded. > > > + ???????loaded.add(lib); > > > + ???} > > > +} > > > diff -Naur rxtx-2.1-7pre17-orig/src/RS485.java > rxtx-2.1-7pre17-mod/src/RS485.java > > > --- rxtx-2.1-7pre17-orig/src/RS485.java?2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/RS485.java??2005-02-26 13:28:09.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRS485" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRS485" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java > rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXCommDriver.java????????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXCommDriver.java?2005-02-26 > 13:28:27.000000000 -0500 > > > @@ -41,7 +41,7 @@ > > > ????????static > > > ????????{ > > > ???????????????if(debug ) System.out.println("RXTXCommDriver {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ? > > > ???????????????/* > > > ??????????????? ??Perform a crude check to make sure people don't mix > > > diff -Naur rxtx-2.1-7pre17-orig/src/RXTXPort.java > rxtx-2.1-7pre17-mod/src/RXTXPort.java > > > --- rxtx-2.1-7pre17-orig/src/RXTXPort.java??????2003-07-17 > 22:20:26.000000000 -0400 > > > +++ rxtx-2.1-7pre17-mod/src/RXTXPort.java???????2005-02-26 > 13:28:47.000000000 -0500 > > > @@ -51,7 +51,7 @@ > > > ? > > > ???????????????if(debug ) > > > ??????????????????????z.reportln( "RXTXPort {}"); > > > -??????????????System.loadLibrary( "rxtxSerial" ); > > > +??????????????LibLoader.loadLibrary( "rxtxSerial" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > diff -Naur rxtx-2.1-7pre17-orig/src/Raw.java > rxtx-2.1-7pre17-mod/src/Raw.java > > > --- rxtx-2.1-7pre17-orig/src/Raw.java???2002-04-05 12:05:16.000000000 > -0500 > > > +++ rxtx-2.1-7pre17-mod/src/Raw.java????2005-02-26 13:29:05.000000000 > -0500 > > > @@ -32,7 +32,7 @@ > > > ? > > > ????????static > > > ????????{ > > > -??????????????System.loadLibrary( "rxtxRaw" ); > > > +??????????????LibLoader.loadLibrary( "rxtxRaw" ); > > > ???????????????Initialize(); > > > ????????} > > > ? > > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > Dmitry Markman From thomas.shulok at lmco.com Fri Apr 8 10:38:55 2005 From: thomas.shulok at lmco.com (Shulok, Thomas) Date: Fri, 08 Apr 2005 12:38:55 -0400 Subject: [Rxtx] Input/output error in writeArray Message-ID: Hi Trent, Thanks for the prompt response. Before diving deeper, I was wondering if there is a timeout parameter somewhere in the stack that I have not set properly. Given the nature of the failure (only fails if the line has been idle for a few seconds), it feels like some kind of timeout issue... Thanks again, Thom -----Original Message----- From: rxtx-bounces at mail.linuxgrrls.org [mailto:rxtx-bounces at mail.linuxgrrls.org] On Behalf Of Trent Jarvi Sent: Thursday, April 07, 2005 6:23 PM To: Java RXTX discussion Subject: Re: [Rxtx] Input/output error in writeArray On Thu, 7 Apr 2005, Shulok, Thomas wrote: > Hi There, > > I'm attempting to talk RS232 between an embedded Linux box and a > Windows box. Everything connects up fine, and I can send and receive > a simple sequence of bytes with no problems. However, if around 5 > seconds goes by without me sending something, I get the following when > I attempt to send. > > java.io.IOException: Input/output error in writeArray > > Stack trace: > java/lang/Throwable.()V > java/lang/Throwable.(Ljava/lang/String;)V > java/io/IOException.(Ljava/lang/String;)V > gnu/io/RXTXPort.writeArray([BIIZ)V > gnu/io/RXTXPort$SerialOutputStream.write([B)V > SerialTest.main([Ljava/lang/String;)V > > If there interval is shorter (say 2 seconds between sends), I have no > problems. > > On the Linux box, I'm running RXTXcomm-2.0-7pre2.jar and > librxtxSerial-2.0.7pre2.so. > > Any ideas? > > Thanks, > Thom > > I'm not aware of anything like this. What you may try doing is replacing rxtx with kermit or minicom to see if the problem is reproducable without rxtx. I'm assuming the OS just told rxtx the low level right resulted in an IO error. I'm not sure what rxtx can do as the C level write() is failing. Thats below rxtx. You can read about write() in "man 2 write." RXTX is getting an EIO from the system. Perhaps if the File Descriptor is being corrupted you will see that. You could do printf("filedescriptor = %i\n", fd); in SerialImp.c writArray and see if it changes. It should not change in theory. -- Trent Jarvi taj at www.linux.org.uk _______________________________________________ Rxtx mailing list Rxtx at mail.linuxgrrls.org http://mail.linuxgrrls.org/mailman/listinfo/rxtx From moritz.gmelin at gmx.de Tue Apr 12 08:56:14 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 16:56:14 +0200 Subject: [Rxtx] RFax with RXTX on Windows Message-ID: Hi List, I just tried sending faxes with Java on Windows using the rfax library. Unfortunately, this doesn't work with the RXTX-Comm libraries The Transfer just stops after 2-3 Lines of Fax and the software tells me that the fax was successfully sent. It does work with RXTX from MacOS X. It also works with SUNs COMMAPI Classes on Windows. Has anybody heared of this problem or can image what could cause this kind of behaviour ? Thanks Moritz From moritz.gmelin at gmx.de Tue Apr 12 09:51:29 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 17:51:29 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: Uh, rfax is sending very large data packets (> 5000 bytes) at once when it is transferring the FAX-Data. This seems to be broken in Windows with RXTX. Can anybody confirm this problem ? M. Am 12.04.2005 um 16:56 schrieb Moritz Gmelin: > Hi List, > > I just tried sending faxes with Java on Windows using the rfax > library. Unfortunately, this doesn't work with the RXTX-Comm libraries > The Transfer just stops after 2-3 Lines of Fax and the software tells > me that the fax was successfully sent. It does work with RXTX from > MacOS X. It also works with SUNs COMMAPI Classes on Windows. > Has anybody heared of this problem or can image what could cause this > kind of behaviour ? > > Thanks > > Moritz > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Tue Apr 12 12:14:08 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 12 Apr 2005 19:14:08 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: On Tue, 12 Apr 2005, Moritz Gmelin wrote: > Uh, > > rfax is sending very large data packets (> 5000 bytes) at once when it > is transferring the FAX-Data. > This seems to be broken in Windows with RXTX. > Can anybody confirm this problem ? > Hi Moritz It sounds like the writes() are overflowing the output buffer. RXTX does not have buffers so without flow control, I can picture this happening. You could try turning on hardware flow control, modify RXTXPort.java to break up the writes and use output buffer empty events to throttle it, or a circular buffer could be implemented in the native code. "Up to 16 bytes can be written at once to the transmitter FIFO buffer while processing one transmitter interrupt if an 16550 UART is used, while the 16650 can write up to 32 bytes at once, and the 16750 can write up to 64 bytes." http://www.marshallsoft.com/rs232.htm -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Tue Apr 12 12:44:42 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Tue, 12 Apr 2005 20:44:42 +0200 Subject: [Rxtx] RFax with RXTX on Windows ---- RXTX Bug in Windows ? In-Reply-To: References: Message-ID: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Flow Control is set to RTS_CTS on Input and Output while this is happening ! M. Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > On Tue, 12 Apr 2005, Moritz Gmelin wrote: > >> Uh, >> >> rfax is sending very large data packets (> 5000 bytes) at once when it >> is transferring the FAX-Data. >> This seems to be broken in Windows with RXTX. >> Can anybody confirm this problem ? >> > > Hi Moritz > > It sounds like the writes() are overflowing the output buffer. > > RXTX does not have buffers so without flow control, I can picture this > happening. > > You could try turning on hardware flow control, modify RXTXPort.java to > break up the writes and use output buffer empty events to throttle it, > or > a circular buffer could be implemented in the native code. > > "Up to 16 bytes can be written at once to the transmitter FIFO buffer > while processing one transmitter interrupt if an 16550 UART is used, > while > the 16650 can write up to 32 bytes at once, and the 16750 can write up > to > 64 bytes." > > > http://www.marshallsoft.com/rs232.htm > > > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 02:30:53 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 10:30:53 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: Hi, even after breaking down the large data into packets of 16 bytes followed by a flush() on the stream, data is still lost. While I cannot reproduce this problem with my PC and my Modem, a customer is reporting this. Would it help to work with the notifyOnOutputBufferEmpty() to wait until everything is written ? M. Am 12.04.2005 um 20:44 schrieb Moritz Gmelin: > Flow Control is set to RTS_CTS on Input and Output while this is > happening ! > > M. > > Am 12.04.2005 um 20:14 schrieb Trent Jarvi: > >> On Tue, 12 Apr 2005, Moritz Gmelin wrote: >> >>> Uh, >>> >>> rfax is sending very large data packets (> 5000 bytes) at once when >>> it >>> is transferring the FAX-Data. >>> This seems to be broken in Windows with RXTX. >>> Can anybody confirm this problem ? >>> >> >> Hi Moritz >> >> It sounds like the writes() are overflowing the output buffer. >> >> RXTX does not have buffers so without flow control, I can picture this >> happening. >> >> You could try turning on hardware flow control, modify RXTXPort.java >> to >> break up the writes and use output buffer empty events to throttle >> it, or >> a circular buffer could be implemented in the native code. >> >> "Up to 16 bytes can be written at once to the transmitter FIFO buffer >> while processing one transmitter interrupt if an 16550 UART is used, >> while >> the 16650 can write up to 32 bytes at once, and the 16750 can write >> up to >> 64 bytes." >> >> >> http://www.marshallsoft.com/rs232.htm >> >> >> >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 03:16:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 10:16:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > Hi, > > even after breaking down the large data into packets of 16 bytes > followed by a flush() on the stream, data is still lost. > While I cannot reproduce this problem with my PC and my Modem, a > customer is reporting this. > Would it help to work with the notifyOnOutputBufferEmpty() to wait > until everything is written ? > Hi Moritz I'm curious what modem they have. We will probably see this again. When you said the Sun driver was working, was that on your customers machine or did you see rxtx behaving differently that Sun on your machine? The notifyOnOutputBufferEmpty() is used fairly often by some. It should be reliable. I tried looking at the rxtx code and did not see anything obvious that could be causing a problem. There is a great deal of debugging code in there thats turned off. hardware flow control should deal with the problem so I'm somewhat confused. I glanced at the software web site you mentioned. I don't think its safe for me to download their software given their license regarding design, concepts, ... It would just be looking for trouble for me to examine the product. The last time I heard about something like this, someone was sending 64 meg files related with GPS info on linux many years ago. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 03:30:00 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 11:30:00 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> Message-ID: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> The sun API behaves differently than RXTX on my machine. So this is reproducable. On my machine (with my Modem) it was able to reduce packet size to 100 bytes, which made it work. On the customers machine, this did not help. Only switching to SUN solved the problem for him. I'll try to add the notification now and see if this helps. M. Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> Hi, >> >> even after breaking down the large data into packets of 16 bytes >> followed by a flush() on the stream, data is still lost. >> While I cannot reproduce this problem with my PC and my Modem, a >> customer is reporting this. >> Would it help to work with the notifyOnOutputBufferEmpty() to wait >> until everything is written ? >> > > Hi Moritz > > I'm curious what modem they have. We will probably see this again. > When > you said the Sun driver was working, was that on your customers > machine or > did you see rxtx behaving differently that Sun on your machine? > > The notifyOnOutputBufferEmpty() is used fairly often by some. It > should > be reliable. I tried looking at the rxtx code and did not see anything > obvious that could be causing a problem. There is a great deal of > debugging code in there thats turned off. hardware flow control should > deal with the problem so I'm somewhat confused. > > I glanced at the software web site you mentioned. I don't think its > safe > for me to download their software given their license regarding design, > concepts, ... It would just be looking for trouble for me to examine > the > product. > > The last time I heard about something like this, someone was sending 64 > meg files related with GPS info on linux many years ago. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From moritz.gmelin at gmx.de Thu Apr 14 10:36:33 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 18:36:33 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <2a484563f2be2bff99f8adf21d4245f0@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: When setting setReceiveTimeout() to 10sec, it works with RXTX on Windows ??? The OutputBufferNotification() did nothing good. any explanation for that ? M. Am 14.04.2005 um 11:30 schrieb Moritz Gmelin: > The sun API behaves differently than RXTX on my machine. So this is > reproducable. > On my machine (with my Modem) it was able to reduce packet size to 100 > bytes, which made it work. > On the customers machine, this did not help. Only switching to SUN > solved the problem for him. > > I'll try to add the notification now and see if this helps. > > M. > > > > Am 14.04.2005 um 11:16 schrieb Trent Jarvi: > >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> Hi, >>> >>> even after breaking down the large data into packets of 16 bytes >>> followed by a flush() on the stream, data is still lost. >>> While I cannot reproduce this problem with my PC and my Modem, a >>> customer is reporting this. >>> Would it help to work with the notifyOnOutputBufferEmpty() to wait >>> until everything is written ? >>> >> >> Hi Moritz >> >> I'm curious what modem they have. We will probably see this again. >> When >> you said the Sun driver was working, was that on your customers >> machine or >> did you see rxtx behaving differently that Sun on your machine? >> >> The notifyOnOutputBufferEmpty() is used fairly often by some. It >> should >> be reliable. I tried looking at the rxtx code and did not see >> anything >> obvious that could be causing a problem. There is a great deal of >> debugging code in there thats turned off. hardware flow control >> should >> deal with the problem so I'm somewhat confused. >> >> I glanced at the software web site you mentioned. I don't think its >> safe >> for me to download their software given their license regarding >> design, >> concepts, ... It would just be looking for trouble for me to examine >> the >> product. >> >> The last time I heard about something like this, someone was sending >> 64 >> meg files related with GPS info on linux many years ago. >> >> -- >> Trent Jarvi >> taj at www.linux.org.uk >> _______________________________________________ >> Rxtx mailing list >> Rxtx at mail.linuxgrrls.org >> http://mail.linuxgrrls.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 11:58:03 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 18:58:03 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > When setting setReceiveTimeout() to 10sec, it works with RXTX on > Windows ??? > > The OutputBufferNotification() did nothing good. > > any explanation for that ? > > M. > > > Hi Moritz Ah.. The default timeouts and thresholds are not documented. RXTX will probably not match Sun there because I do not know what they should be. That would make sense. If you know what the Sun defaults are, I can change rxtx to match that. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 14 13:02:47 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:02:47 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: On Thu, 14 Apr 2005, Trent Jarvi wrote: > > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > > > When setting setReceiveTimeout() to 10sec, it works with RXTX on > > Windows ??? > > > > The OutputBufferNotification() did nothing good. > > > > any explanation for that ? > > > > M. > > > > > > > > Hi Moritz > > Ah.. The default timeouts and thresholds are not documented. RXTX will > probably not match Sun there because I do not know what they should be. > > That would make sense. If you know what the Sun defaults are, I can > change rxtx to match that. > > Just one more note now that we are looking at timeouts. RXTX timeouts do not offer the granularity that windows can offer. On Unix and Linux, the minimum nonzero timeout is 100 MS. As Java is supposed to be platform neutral, the integer timeout is divided by 100 before even doing the windows or Unix/Linux native calls. Sometimes this causes problems for people that develop on w32 with Sun's CommAPI, set the Timeout to lower numbers then expect Solaris or Linux to behave the same. This is all related to the POSIX termios.c_cc[ VTIME ] behavior. VTIME is defined in deciseconds. Perhaps it would make sense to print a big warning when the modula of timeout/100 is nonzero. if ( timeout % 100 ) System.err.println("[RXTX] Warning Timeout..."); This may not make sense but rxtx sets the w32 [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME as timeout/100. -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 13:23:50 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 21:23:50 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> Message-ID: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> It sure is related to the way RXTX is handling read timeouts. RFAX sets it readTimeout to 1000 with suns commapi. If I increase that number to 10000, everything works fine. If I keep it at 1000 and simply ignore every -1 value received, it does not work although, I'd suppose this would be the same behaviour as setting the readTimeout to infinitely high. If I set disableReadTimeout(), read() still returns -1 if there is no data available (is this correct ?) but If I ignore those -1 values, the software works perfectly ! M. Am 14.04.2005 um 21:02 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Trent Jarvi wrote: > >> >> On Thu, 14 Apr 2005, Moritz Gmelin wrote: >> >>> When setting setReceiveTimeout() to 10sec, it works with RXTX on >>> Windows ??? >>> >>> The OutputBufferNotification() did nothing good. >>> >>> any explanation for that ? >>> >>> M. >>> >>> >>> >> >> Hi Moritz >> >> Ah.. The default timeouts and thresholds are not documented. RXTX >> will >> probably not match Sun there because I do not know what they should >> be. >> >> That would make sense. If you know what the Sun defaults are, I can >> change rxtx to match that. >> >> > > Just one more note now that we are looking at timeouts. RXTX timeouts > do > not offer the granularity that windows can offer. On Unix and Linux, > the > minimum nonzero timeout is 100 MS. As Java is supposed to be platform > neutral, the integer timeout is divided by 100 before even doing the > windows or Unix/Linux native calls. > > Sometimes this causes problems for people that develop on w32 with > Sun's > CommAPI, set the Timeout to lower numbers then expect Solaris or Linux > to > behave the same. > > This is all related to the POSIX termios.c_cc[ VTIME ] behavior. > VTIME is > defined in deciseconds. Perhaps it would make sense to print a big > warning when the modula of timeout/100 is nonzero. > > if ( timeout % 100 ) > System.err.println("[RXTX] Warning Timeout..."); > > This may not make sense but rxtx sets the w32 > [Read/Write]TotalTimeoutConstant to VTIME*100 after calculating VTIME > as > timeout/100. > > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 13:42:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 20:42:51 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <07bccd05feb498dc37f063c2cf1362c1@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > It sure is related to the way RXTX is handling read timeouts. > > RFAX sets it readTimeout to 1000 with suns commapi. > > If I increase that number to 10000, everything works fine. > > If I keep it at 1000 and simply ignore every -1 value received, it does > not work although, I'd suppose this would be the same behaviour as > setting the readTimeout to infinitely high. > > If I set disableReadTimeout(), read() still returns -1 if there is no > data available (is this correct ?) but If I ignore those -1 values, the > software works perfectly ! > Hi Moritz The behavior of read is dependant upon the timeout and threshold. see the getInputStream() comments here for more information. http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html What you mention does not sound correct, but perhaps you could be more specific after seeing the chart and comments. Perhaps another error is occuring during read() that is not handled right. I _think_ rxtx is setting up the COMMTIMEOUTS structure correctly in termios.c:tcsetattr(). -- Trent Jarvi taj at www.linux.org.uk From moritz.gmelin at gmx.de Thu Apr 14 14:34:31 2005 From: moritz.gmelin at gmx.de (Moritz Gmelin) Date: Thu, 14 Apr 2005 22:34:31 +0200 Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> Message-ID: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> I call disableReceiveThreshold() and disableReceiveTimeout() and still read() returns -1 when no data is available from that port. When enableReceiveTimeout() is set to some value, read() actually blocks for that number of ms specified. FlowControl is set to RTS/CTS on Input and Output. Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. M. Am 14.04.2005 um 21:42 schrieb Trent Jarvi: > On Thu, 14 Apr 2005, Moritz Gmelin wrote: > >> It sure is related to the way RXTX is handling read timeouts. >> >> RFAX sets it readTimeout to 1000 with suns commapi. >> >> If I increase that number to 10000, everything works fine. >> >> If I keep it at 1000 and simply ignore every -1 value received, it >> does >> not work although, I'd suppose this would be the same behaviour as >> setting the readTimeout to infinitely high. >> >> If I set disableReadTimeout(), read() still returns -1 if there is no >> data available (is this correct ?) but If I ignore those -1 values, >> the >> software works perfectly ! >> > > Hi Moritz > > The behavior of read is dependant upon the timeout and threshold. > > see the getInputStream() comments here for more information. > > http://java.sun.com/products/javacomm/javadocs/javax/comm/CommPort.html > > What you mention does not sound correct, but perhaps you could be more > specific after seeing the chart and comments. Perhaps another error is > occuring during read() that is not handled right. I _think_ rxtx is > setting up the COMMTIMEOUTS structure correctly in > termios.c:tcsetattr(). > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Thu Apr 14 15:32:29 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 14 Apr 2005 22:32:29 +0100 (BST) Subject: [Rxtx] RFax with RXTX on Windows ----Problem persists In-Reply-To: <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> References: <4f3cf8f7dc20c3a6ed36b92f0cb2b045@gmx.de> <2a484563f2be2bff99f8adf21d4245f0@gmx.de> <07bccd05feb498dc37f063c2cf1362c1@gmx.de> <072dfe44ad02131984ca30fb22ff5bf4@gmx.de> Message-ID: On Thu, 14 Apr 2005, Moritz Gmelin wrote: > I call disableReceiveThreshold() and disableReceiveTimeout() and still > read() returns -1 when no data is available from that port. > > When enableReceiveTimeout() is set to some value, read() actually > blocks for that number of ms specified. > > FlowControl is set to RTS/CTS on Input and Output. > > Is that reproducable ? I tried that with the latest RXTX 2.1.-7pre17. > > M. > Hi Martin I'm going to need to dig up a windows box and try to reproduce this. My guess is there is something in termios.c:serial_read() thats letting the timeout slip past. It may even be an unhandled error condition. I cant see the error but I suspect thats where it is comming from. RXTX has some logic in there to handles timeouts. I wont be able to look at this until the weekend though. If you are looking at the code, it should be the O_NOBOCK case with c_cc[VTIME] = 0. The code is trying to block until cbInQue is the size requested. That first part of serial_read blocking until the data is in the queue is what I would be looking at to see why it failed. -- Trent Jarvi taj at www.linux.org.uk From chen_yulei at 126.com Tue Apr 19 02:45:04 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Tue, 19 Apr 2005 16:45:04 +0800 (CST) Subject: [Rxtx] a problem of using RXTX on win32 Message-ID: <4264C510.0000E3.05039@m55.126.com> Hi, I tried to using rxtx package which is cross-platform to communicate with serial port. My first try is to use the package rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. I have install the package according to the README file. I use the sample provided by java communication api package -- SerialDemo. I have compiled the file successfully, but when I run the demo, it show the message as following: Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no SolarisSerialPar allel in java.library.path Caught java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver c om.sun.comm.SolarisDriver. I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. What's wrong? Can anyone help me with this? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050419/62fa7e52/attachment-0044.html From taj at www.linux.org.uk Tue Apr 19 03:08:20 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 19 Apr 2005 10:08:20 +0100 (BST) Subject: [Rxtx] a problem of using RXTX on win32 In-Reply-To: <4264C510.0000E3.05039@m55.126.com> References: <4264C510.0000E3.05039@m55.126.com> Message-ID: On Tue, 19 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > I tried to using rxtx package which is cross-platform to communicate > with serial port. My first try is to use the package > rxtx-bins.1\1.5\i386-pc-mingw32 on win32 system. Hi Yulei 1.4 works with Sun's CommAPI. The newer version is rxtx 2.0 which may or may not be of more use to you. ftp://ftp.qbang.org/pub/rxtx/rxtx-2.0-CVS-20050120-bins.tar.gz > > I have install the package according to the README file. I use the > sample provided by java communication api package -- SerialDemo. > > I have compiled the file successfully, but when I run the demo, it show > the message as following: > > Error loading SolarisSerial: java.lang.UnsatisfiedLinkError: no > SolarisSerialPar allel in java.library.path Caught > java.lang.UnsatisfiedLinkError: readRegistrySerial while loading driver > c om.sun.comm.SolarisDriver. > > I have already set Driver=gnu.io.RXTXCommDriver in javax.comm.properties. > > What's wrong? Can anyone help me with this? > Either the javax.comm.properties file is misplaced or it does not have the contents you think it does. If the javax.comm.properties file is read by CommAPI properly, you will not see it try to use SolarisSerial. You may just try java -DDriver=gnu.io.RXTXCommDriver SerialDemo which does what the properties file should do. -- Trent Jarvi taj at www.linux.org.uk From mka at exceldata.com Tue Apr 19 16:37:57 2005 From: mka at exceldata.com (mka at exceldata.com) Date: Wed, 20 Apr 2005 00:37:57 +0200 Subject: [Rxtx] POS Printer Message-ID: Hey everyone Having quite an urgent problem, so I hope I guys (and girls) can help me out ... I'm developing an application printing tickets using an Epson POS Printer (TM T88 IIIP) in Java communication printdata (received in complete form from a server) via RXTX to LPT1. I'm expirencing the following error (the whole JVM falls apart): An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C92AE22 Function=RtlImpersonateSelf+0x3A5 Library=C:\WINDOWS\system32\ntdll.dll Current Java thread: at gnu.io.LPRPort.writeArray(Native Method) at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) at com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) at com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) at com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) Dynamic libraries: 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll 0x02CC0000 - 0x02CD2000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll 0x009A0000 - 0x009AD000 C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL Heap at VM Abort: Heap def new generation total 576K, used 99K [0x10010000, 0x100b0000, 0x104f0000) eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, 0x14010000) the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, 0x10650000) compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, 0x18010000) the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, 0x14410000) Local Time = Wed Apr 20 00:26:55 2005 Elapsed Time = 18 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) # Now the "funny"/"weird" part is that it fails only for some sets of bytes passed through RXTX to LPT1. So some sets of bytes works perfectly fine - no problems, ticket are printed nicely - the remaining sets get the ticket printed, but then the JVM dumps. And it's consistent - that it is always the same sets of bytes that makes the JVM fall apart. I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump and tried a 1.4.2 and 1.5.0 VM - the same!!! Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the few entries present indicates that it is something that occurs during other native java operations as well ... which makes the inquery in this list less significant, but I wanted to give it a shot ... Any information is appriciated :) Best regards Mikael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/35ed183e/attachment-0035.html From taj at www.linux.org.uk Tue Apr 19 18:07:10 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 20 Apr 2005 01:07:10 +0100 (BST) Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005 mka at exceldata.com wrote: > Hey everyone > > Having quite an urgent problem, so I hope I guys (and girls) can help me > out ... > > I'm developing an application printing tickets using an Epson POS Printer > (TM T88 IIIP) in Java communication printdata (received in complete form > from a server) via RXTX to LPT1. > > I'm expirencing the following error (the whole JVM falls apart): > > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at > PC=0x7C92AE22 > Function=RtlImpersonateSelf+0x3A5 > Library=C:\WINDOWS\system32\ntdll.dll > > Current Java thread: > at gnu.io.LPRPort.writeArray(Native Method) > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > at > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > at > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > at > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > Dynamic libraries: > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > 0x02CC0000 - 0x02CD2000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > 0x009A0000 - 0x009AD000 > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > Heap at VM Abort: > Heap > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > 0x104f0000) > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > 0x14010000) > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > 0x10650000) > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > 0x18010000) > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > 0x14410000) > > Local Time = Wed Apr 20 00:26:55 2005 > Elapsed Time = 18 > # > # The exception above was detected in native code outside the VM > # > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > # > > > Now the "funny"/"weird" part is that it fails only for some sets of bytes > passed through RXTX to LPT1. So some sets of bytes works perfectly fine - > no problems, ticket are printed nicely - the remaining sets get the ticket > printed, but then the JVM dumps. And it's consistent - that it is always > the same sets of bytes that makes the JVM fall apart. > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the dump > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but the > few entries present indicates that it is something that occurs during > other native java operations as well ... which makes the inquery in this > list less significant, but I wanted to give it a shot ... > Hi Mikael yuck :) I looked through the code and could not see anything in the writeArray(). I really don't know what to say. It may be a thread problem. But I dont see where. If you have someone on staff that can look at this in detail and knows C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh accounts just have the source ready to build with a make command so you dont need to waste time setting up the rather involved builds. I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest "solutions" I saw was removing spaces from the classpath or shortening the classpath. Some of the blowups are mouse related. I just dont know what to think. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Wed Apr 20 02:56:19 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 20 Apr 2005 09:56:19 +0100 Subject: [Rxtx] POS Printer In-Reply-To: References: Message-ID: <42661933.3000308@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050420/70c2c46f/attachment-0044.html From mikkal56 at hotmail.com Wed Apr 20 07:06:08 2005 From: mikkal56 at hotmail.com (miguel lam) Date: Wed, 20 Apr 2005 13:06:08 +0000 Subject: [Rxtx] POS Printer In-Reply-To: Message-ID: Hi, we are using rxtx for read data from serial port, and for write to the parellel or serial printers that we have, we are openning the port as a filesystem file, for example for the serial port we are using an Stream to the /dev/lp0 in linux, and we send the bytes to that port, i mean we are trying the printers ports as a normal file in a stream, it works well, if it its urgent you better make this change to your code. I hope it helps. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From chen_yulei at 126.com Sun Apr 24 21:27:09 2005 From: chen_yulei at 126.com (=?gb2312?B?Y2hlbl95dWxlaQ==?=) Date: Mon, 25 Apr 2005 11:27:09 +0800 (CST) Subject: [Rxtx] where is the sample programe source of RXTX Message-ID: <426C638D.000105.09711@m57.126.com> Hi, Can anyone tell me where is the sample programe source of RXTX? Thanks! Regards, Yulei -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/af5227a5/attachment-0044.html From taj at www.linux.org.uk Sun Apr 24 23:22:46 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 06:22:46 +0100 (BST) Subject: [Rxtx] where is the sample programe source of RXTX In-Reply-To: <426C638D.000105.09711@m57.126.com> References: <426C638D.000105.09711@m57.126.com> Message-ID: On Mon, 25 Apr 2005, [gb2312] chen_yulei wrote: > Hi, > > Can anyone tell me where is the sample programe source of RXTX? > > Thanks! > > Regards, > Yulei There are some simple examples in the contrib directory with the rxtx source. There are also examples available with Sun's CommAPI. With rxtx 2.1 you just change import javax.comm.*; to import gnu.io.*; Everything else should be the same. With rxtx 2.0 you just follow the instructions in Sun's CommAPI. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 01:50:52 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 08:50:52 +0100 (BST) Subject: Vids.: Re: [Rxtx] POS Printer (fwd) Message-ID: Mikael has had some success with the bob account resolving his problem. I'll share more as I recieve it. -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Mon, 25 Apr 2005 09:08:03 +0200 From: mka at exceldata.com To: Trent Jarvi Subject: Re: Vids.: Re: [Rxtx] POS Printer Hey Trent I've made my own DLL inspired by your code which doesn't fail for the sequence of bytes the rxtx DLL's failed ... but it haven't been able to reproduce the error with your DLL's when not performing the write to the file LPT1 (yet), so I can't tell you what is wrong (yet) ... but in my DLL I open and close the handle on each invocation of a method similar to WriteArray (and it's a win32 version *only*) and I use C++ memory operations (new/delete instead of malloc). When/if I find you what might be wrong in your DLL, I'll let you know ... Med venlig hilsen / Best regards / Mit freundlichen Gr?ssen Mikael Andersen - Systemkonsulent > > On Wed, 20 Apr 2005 mka at exceldata.com wrote: > > > > > Hey everyone > > > > > > Having quite an urgent problem, so I hope I guys (and girls) can help > me > > > > > out ... > > > > > > I'm developing an application printing tickets using an Epson POS > > Printer > > > (TM T88 IIIP) in Java communication printdata (received in complete > form > > > > > from a server) via RXTX to LPT1. > > > > > > I'm expirencing the following error (the whole JVM falls apart): > > > > > > > > > An unexpected exception has been detected in native code outside the > VM. > > > Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred > at > > > PC=0x7C92AE22 > > > Function=RtlImpersonateSelf+0x3A5 > > > Library=C:\WINDOWS\system32\ntdll.dll > > > > > > Current Java thread: > > > at gnu.io.LPRPort.writeArray(Native Method) > > > at gnu.io.LPRPort$ParallelOutputStream.write(LPRPort.java:286) > > > - locked <0x10016888> (a gnu.io.LPRPort$ParallelOutputStream) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.RXTXPrinterImpl.print(RXTXPrinterImpl.java:59) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printer.EpsonTM8IIIPrinter.print(EpsonTM8IIIPrinter.java:89) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.processInput(PrintServer.java:90) > > > at > > > > > > com.exceldata.customers.ssl.paymentterminal.printserver.PrintServer.main(PrintServer.java:72) > > > > > > Dynamic libraries: > > > 0x00400000 - 0x0040B000 C:\j2sdk1.4.2_07\jre\bin\java.exe > > > 0x7C900000 - 0x7C9B2000 C:\WINDOWS\system32\ntdll.dll > > > 0x7C800000 - 0x7C8F8000 C:\WINDOWS\system32\kernel32.dll > > > 0x77DC0000 - 0x77E6B000 C:\WINDOWS\system32\ADVAPI32.dll > > > 0x77E70000 - 0x77F01000 C:\WINDOWS\system32\RPCRT4.dll > > > 0x77C00000 - 0x77C58000 C:\WINDOWS\system32\MSVCRT.dll > > > 0x08000000 - 0x08138000 C:\j2sdk1.4.2_07\jre\bin\client\jvm.dll > > > 0x77D30000 - 0x77DC0000 C:\WINDOWS\system32\USER32.dll > > > 0x77F10000 - 0x77F56000 C:\WINDOWS\system32\GDI32.dll > > > 0x76B30000 - 0x76B5E000 C:\WINDOWS\system32\WINMM.dll > > > 0x10000000 - 0x10007000 C:\j2sdk1.4.2_07\jre\bin\hpi.dll > > > 0x003E0000 - 0x003EE000 C:\j2sdk1.4.2_07\jre\bin\verify.dll > > > 0x008A0000 - 0x008B9000 C:\j2sdk1.4.2_07\jre\bin\java.dll > > > 0x008C0000 - 0x008CD000 C:\j2sdk1.4.2_07\jre\bin\zip.dll > > > 0x02CC0000 - 0x02CD2000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxSerial.dll > > > 0x73D40000 - 0x73D67000 C:\WINDOWS\system32\crtdll.dll > > > 0x009A0000 - 0x009AD000 > > > > > > C:\javaudv\workspace\SSLBetalingsTerminal\native_libraries\rxtxParallel.dll > > > 0x76C80000 - 0x76CA8000 C:\WINDOWS\system32\imagehlp.dll > > > 0x59F30000 - 0x59FD1000 C:\WINDOWS\system32\DBGHELP.dll > > > 0x77BF0000 - 0x77BF8000 C:\WINDOWS\system32\VERSION.dll > > > 0x76BE0000 - 0x76BEB000 C:\WINDOWS\system32\PSAPI.DLL > > > > > > Heap at VM Abort: > > > Heap > > > def new generation total 576K, used 99K [0x10010000, 0x100b0000, > > > 0x104f0000) > > > eden space 512K, 6% used [0x10010000, 0x10018e00, 0x10090000) > > > from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000) > > > to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000) > > > tenured generation total 1408K, used 46K [0x104f0000, 0x10650000, > > > 0x14010000) > > > the space 1408K, 3% used [0x104f0000, 0x104fba40, 0x104fbc00, > > > 0x10650000) > > > compacting perm gen total 4096K, used 1116K [0x14010000, 0x14410000, > > > > 0x18010000) > > > the space 4096K, 27% used [0x14010000, 0x141272b0, 0x14127400, > > > 0x14410000) > > > > > > Local Time = Wed Apr 20 00:26:55 2005 > > > Elapsed Time = 18 > > > # > > > # The exception above was detected in native code outside the VM > > > # > > > # Java VM: Java HotSpot(TM) Client VM (1.4.2_07-b05 mixed mode) > > > # > > > > > > > > > Now the "funny"/"weird" part is that it fails only for some sets of > > bytes > > > passed through RXTX to LPT1. So some sets of bytes works perfectly > fine > > - > > > no problems, ticket are printed nicely - the remaining sets get the > > ticket > > > printed, but then the JVM dumps. And it's consistent - that it is > always > > > > > the same sets of bytes that makes the JVM fall apart. > > > > > > I'm tried RXTX-2.1-7pre17 and RXTX-2.1-7pre20 - both resulting in the > > dump > > > and tried a 1.4.2 and 1.5.0 VM - the same!!! > > > > > > Google doesn't show up a lot regarding "RtlImpersonateSelf+0x3A5" but > > the > > > few entries present indicates that it is something that occurs during > > > other native java operations as well ... which makes the inquery in > this > > > > > list less significant, but I wanted to give it a shot ... > > > > > > > Hi Mikael > > > > yuck :) > > > > I looked through the code and could not see anything in the > writeArray(). > > > > I really don't know what to say. It may be a thread problem. But I > dont > > see where. > > > > If you have someone on staff that can look at this in detail and knows > > C/C++ code, I can setup a 'bob' account for you off the list. Bob ssh > > accounts just have the source ready to build with a make command so you > > dont need to waste time setting up the rather involved builds. > > > > I googled for RtlImpersonateSelf+0x3A5 also. One of the strangest > > "solutions" I saw was removing spaces from the classpath or shortening > the > > > > classpath. Some of the blowups are mouse related. I just dont know > what > > to think. > > > > > > > > > > -- Trent Jarvi taj at www.linux.org.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 1267 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050425/4db8fe59/attachment-0044.gif From mark at panonet.net Mon Apr 25 10:47:29 2005 From: mark at panonet.net (Mark Anderson) Date: Mon, 25 Apr 2005 17:47:29 +0100 Subject: [Rxtx] EINTR issue with CNI Message-ID: <200504251747.29240.mark@panonet.net> I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes interrupt the SELECT call in read_byte_array, causing an IOException. Is there a way to ignore EINTR for SELECT? I tried using the same if statement as is used to ignore EINTR for the READ call but this just caused an EOFException. Thanks, Mark From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Mon Apr 25 15:41:42 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Mon, 25 Apr 2005 22:41:42 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504251747.29240.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> Message-ID: On Mon, 25 Apr 2005, Mark Anderson wrote: > I am running the CNI code with GCJ and I am seeing an EINTR signal sometimes > interrupt the SELECT call in read_byte_array, causing an IOException. > > Is there a way to ignore EINTR for SELECT? I tried using the same if statement > as is used to ignore EINTR for the READ call but this just caused an > EOFException. > Assuming this is Linux, the only thing you can do on EINTR is restart the select() as you suggest you are trying. I'm curious about the EOFException as that is not comming from rxtx. I'm not sure what EOFException means in this context. Something recieved control-D? The read failed? read returned 0 bytes (timed out)? If you have made any minor fixes with the CNI code, please do share them with the list and I'll put them in. I know that code is a bit stale as I just did it out of courisity at the time. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Tue Apr 26 08:51:27 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Tue, 26 Apr 2005 10:51:27 -0400 Subject: [Rxtx] Closing a serial port blocked in a read Message-ID: <2064580f29b13270effaa385aaeaee25@baseview.com> Greetings everybody, I was, perhaps naively, hoping to write some code using RXTX that would have several threads, each with its own inputstream and reading from that inputstream using blocking reads. Some of these inputstreams would come from serial ports, of course ;-) Occasionally, for one reason or another, a thread may no longer needed, so we'd like to recover the resources associated with it, i.e. the serial port, so that another thread could read from that port. A problem arises when the thread we no longer need is blocking on a read on the serial port's inputstream... we can't close the serial port because of the blocking read. I've looked at the source and seen where the lock variable get incremented on entry to the read methods and decremented on exit, and also where the serial port close method checks the lock variable. Any suggestions on how to get around the problem of closing a serial port that has an inputstream blocked on a read? I'd read on a Sun java forum once (but lost the URL) that if an inputstream from a Socket is blocked on a read that you can call close on the inputstream from outside the thread that's blocked on the read and the read will throw an exception and you can then close the Socket... I take it that serial ports have a different spec? I didn't notice anything in the docs to suggest one way or the other. I realize I could use a timeout to avoid the problem, but since the timeout's advisory we can't rely on vendors having implemented it... I also realize that we could use the serial port events, but I don't want the reading threads to have to be serial port event listeners... I suppose I could wrap the event stuff in a SerialPortInputStream class. Have I missed any obvious, easy ways of closing the serial port when its inputstream is blocked in a read? Thanks in advance for any info you can provide. Sean From frank-list at uol.com.br Tue Apr 26 14:32:29 2005 From: frank-list at uol.com.br (frank-list) Date: Tue, 26 Apr 2005 17:32:29 -0300 Subject: [Rxtx] RXTX disabling serial ports Message-ID: I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As soon the driver is started, the mouse stop working. I opened the source code and saw that it eventually calls a function called "serial_test" in termios.c, to test every serial port from 1 to 256. I think the CreateFile function in serial_test is resetting the com port although it is currently being used by the mouse. Is there any way to solve this situation? Besides writing a properties file with the allowed ports? Any response is deeply appreciated. Francisco __________________________________________________________________________ Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - ? gr?tis! http://antipopup.uol.com.br/ From mark at panonet.net Wed Apr 27 02:39:58 2005 From: mark at panonet.net (Mark Anderson) Date: Wed, 27 Apr 2005 09:39:58 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> Message-ID: <200504270939.58715.mark@panonet.net> On Monday 25 April 2005 22:41, Trent Jarvi wrote: > On Mon, 25 Apr 2005, Mark Anderson wrote: > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > sometimes interrupt the SELECT call in read_byte_array, causing an > > IOException. > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > statement as is used to ignore EINTR for the READ call but this just > > caused an EOFException. > > Assuming this is Linux, the only thing you can do on EINTR is restart the > select() as you suggest you are trying. I'm curious about the > EOFException as that is not comming from rxtx. > > I'm not sure what EOFException means in this context. Something recieved > control-D? The read failed? read returned 0 bytes (timed out)? > > If you have made any minor fixes with the CNI code, please do share them > with the list and I'll put them in. I know that code is a bit stale as I > just did it out of courisity at the time. > OK here is a patch that has solved the problem for me. The garbage collector in GCJ uses the SIGPWR signal internally but this seems to interrupt the SELECT call if that is happening when GC occurs. So my patch uses sigprocmask to block SIGPWR signals while we are calling SELECT. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 800 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/74a6cdcb/attachment-0012.bin From taj at www.linux.org.uk Wed Apr 27 14:18:40 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:18:40 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > Thanks Mark I didnt realize this was the case. I'll put your patch into CVS today. Thanks again. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Wed Apr 27 14:22:37 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Wed, 27 Apr 2005 21:22:37 +0100 (BST) Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: On Tue, 26 Apr 2005, frank-list wrote: > I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As > soon the driver is started, the mouse stop working. I opened > the source code and saw that it eventually calls a function > called "serial_test" in termios.c, to test every serial port > from 1 to 256. I think the CreateFile function in > serial_test is resetting the com port although it is > currently being used by the mouse. Is there any way to solve > this situation? Besides writing a properties file with the > allowed ports? Any response is deeply appreciated. > I had not noticed this when I tested windows 98 but it has been some time. I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests that win98 is going to be problematic with enumeration as it is now. How is rxtx supposed to know what ports are in use by terminal programs, a mouse, ... Some user intervention is going to be required from what I can tell. -- Trent Jarvi taj at www.linux.org.uk From frank-list at uol.com.br Wed Apr 27 14:55:09 2005 From: frank-list at uol.com.br (Francisco Areas Guimaraes) Date: Wed, 27 Apr 2005 17:55:09 -0300 Subject: [Rxtx] RXTX disabling serial ports In-Reply-To: References: Message-ID: <426FFC2D.4090302@uol.com.br> Thanks for the quick response. Actually the mouse is on com 3, but the problem really is how to a port is being used by a terminal program. The solution we thought today is the following: in the initialize method in RXTXCommDriver to skip the scanning and add directly the coms 1 thru 20. When getCommport is called, if it is windows, it calls testRead to check if the port exists. Do you think, there is a better solution? Maybe instead of scanning and adding all ports at the beggining , it could be done only when the port is requested. Attached is the source code I altered. Francisco Ar?as Guimar?es Trent Jarvi wrote: >On Tue, 26 Apr 2005, frank-list wrote: > > > >>I'm using RXTX-2.0-7pre2 with win98 and a serial mouse. As >>soon the driver is started, the mouse stop working. I opened >>the source code and saw that it eventually calls a function >>called "serial_test" in termios.c, to test every serial port >>from 1 to 256. I think the CreateFile function in >>serial_test is resetting the com port although it is >>currently being used by the mouse. Is there any way to solve >>this situation? Besides writing a properties file with the >>allowed ports? Any response is deeply appreciated. >> >> >> > >I had not noticed this when I tested windows 98 but it has been some time. > >I guess we cold have RXTX ignore COM1 on windows 98. The problem suggests >that win98 is going to be problematic with enumeration as it is now. How >is rxtx supposed to know what ports are in use by terminal programs, a >mouse, ... Some user intervention is going to be required from what I can >tell. > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTXCommDriver.java Type: java/* Size: 25622 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050427/bc26e806/attachment-0012.bin From taj at www.linux.org.uk Thu Apr 28 03:19:14 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:19:14 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504270939.58715.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: On Wed, 27 Apr 2005, Mark Anderson wrote: > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > IOException. > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > statement as is used to ignore EINTR for the READ call but this just > > > caused an EOFException. > > > > Assuming this is Linux, the only thing you can do on EINTR is restart the > > select() as you suggest you are trying. I'm curious about the > > EOFException as that is not comming from rxtx. > > > > I'm not sure what EOFException means in this context. Something recieved > > control-D? The read failed? read returned 0 bytes (timed out)? > > > > If you have made any minor fixes with the CNI code, please do share them > > with the list and I'll put them in. I know that code is a bit stale as I > > just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > The garbage collector in GCJ uses the SIGPWR signal internally but this seems > to interrupt the SELECT call if that is happening when GC occurs. So my patch > uses sigprocmask to block SIGPWR signals while we are calling SELECT. > I see I didnt reply to the list. Thanks Mark. I've added the patch to CVS. -- Trent Jarvi taj at www.linux.org.uk From rachel at strangenoises.org Sat Apr 2 10:23:21 2005 From: rachel at strangenoises.org (Rachel Greenham) Date: Sat, 02 Apr 2005 17:23:21 -0000 Subject: [Rxtx] test Message-ID: <424ED51A.9000600@strangenoises.org> test From matt.wallace at motorola.com Wed Apr 20 07:09:15 2005 From: matt.wallace at motorola.com (Wallace Matthew-E50082) Date: Wed, 20 Apr 2005 08:09:15 -0500 Subject: [Rxtx] Compilation problem Message-ID: I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 rxtx-devel' and I ran into some compilation errors: /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' I saw a reference to to this in the archives and that's actually why I went with the CVS version (I saw these errors with the release version as well). It took me a while to figure out what was going on, but (this may be obvious to others) the problem is that the header file had different return and parameter types than the implementation files. I'm guessing this may be some sort of CVS mismatch (perhaps something forgot to be checked in?). Anyways, I changed all the header method declarations to match the implementation ones, and it compiled no problem. I did want to ask though, which one is right? That is, is the Java code expecting types like those that are in the header files and or in the implementation files. Also, I assume this error must have something to do with how the configure/Makefile is setup for my config, so could the fact that I'm using Java 5.0 (release 02) on Linux cause this error? In any event, I think I have it fixed, but I wanted to point it out so it could be fixed in CVS. Thanks, Matt Wallace From lubod at microstep-mis.com Tue Apr 26 02:37:50 2005 From: lubod at microstep-mis.com (Lubo Drobny) Date: Tue, 26 Apr 2005 09:37:50 +0100 Subject: [Rxtx] moxa 218 Turbo/pci Message-ID: <426DFDDE.4000602@microstep-mis.sk> Hello, I use Moxa C218 Turbo PCI serial port card with WinXp with hi-performance mode (save processor time), classical mode working OK. I have problem with write to the port, because I am always getting this error message: on console: Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 Error 0x0 at /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The operation completed successfully. and from my app: 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: Input/output error in writeArray". Stack dump: gnu.io.RXTXPort.writeArray(Native Method) at line -2 gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 java.io.DataOutputStream.write(Unknown Source) at line -1 I have read mail list and found that this error is only false , so I have checked termios.c , but I need some help how to correct it, because it fails on function WriteFile(). Another problem is that after this exception I try to close serial port, but it is deadlocked. So my question is How to recover from it? Thanks for any help. lubo From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 03:42:27 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 10:42:27 +0100 (BST) Subject: [Rxtx] Compilation problem In-Reply-To: References: Message-ID: On Wed, 20 Apr 2005, Wallace Matthew-E50082 wrote: > I grabbed the latest RXTX from CVS using 'checkout -r commapi-0-0-1 > rxtx-devel' and I ran into some compilation errors: > > /home/e50082/rxtx-devel/src/SerialImp.c:1439: error: conflicting types for `Java_gnu_io_RXTXPort_nativeDrain' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:202: error: previous declaration of `Java_gnu_io_RXTXPort_nativeDrain' > /home/e50082/rxtx-devel/src/SerialImp.c:2656: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:266: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetParityErrorChar' > /home/e50082/rxtx-devel/src/SerialImp.c:2686: error: conflicting types for `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > i686-pc-linux-gnu/gnu_io_RXTXPort.h:282: error: previous declaration of `Java_gnu_io_RXTXPort_nativeGetEndOfInputChar' > > I saw a reference to to this in the archives and that's actually why I > went with the CVS version (I saw these errors with the release version > as well). > > It took me a while to figure out what was going on, but (this may be > obvious to others) the problem is that the header file had different > return and parameter types than the implementation files. I'm guessing > this may be some sort of CVS mismatch (perhaps something forgot to be > checked in?). Anyways, I changed all the header method declarations to > match the implementation ones, and it compiled no problem. I did want > to ask though, which one is right? That is, is the Java code expecting > types like those that are in the header files and or in the > implementation files. Also, I assume this error must have something to > do with how the configure/Makefile is setup for my config, so could the > fact that I'm using Java 5.0 (release 02) on Linux cause this error? > In any event, I think I have it fixed, but I wanted to point it out so > it could be fixed in CVS. > Hi Matt I just ran a quick check with rxtx from CVS using Sun 1.5.0_01 and everything compiled fine. I used the same commapi-0-0-1 tag. You may double check your PATH and JAVA_HOME environmental variables to make sure the 1.5 JDK is being called. Fedora has GCJ/java packages too now. I doubt javah changed since 1.5.0_01. Something else must be going on. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Thu Apr 28 14:46:51 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Thu, 28 Apr 2005 21:46:51 +0100 (BST) Subject: [Rxtx] moxa 218 Turbo/pci In-Reply-To: <426DFDDE.4000602@microstep-mis.sk> References: <426DFDDE.4000602@microstep-mis.sk> Message-ID: On Tue, 26 Apr 2005, Lubo Drobny wrote: > Hello, > > I use Moxa C218 Turbo PCI serial port card with WinXp with > hi-performance mode (save processor time), classical mode working OK. > I have problem with write to the port, because I am always getting this > error message: > > on console: > Native lib Version = RXTX-2.1-7pre20 > Java lib Version = RXTX-2.1-7pre20 > Error 0x0 at > /home/bob/rxtx-2.1-CVS-20050120/build/../src/termios.c(1296): The > operation completed successfully. > > and from my app: > 26.04.2005 08:23:36 (UTC): ERROR: Exception "java.io.IOException: > Input/output error in writeArray". Stack dump: > gnu.io.RXTXPort.writeArray(Native Method) at line -2 > gnu.io.RXTXPort$SerialOutputStream.write(RXTXPort.java:1168) at line 1168 > java.io.DataOutputStream.write(Unknown Source) at line -1 > > I have read mail list and found that this error is only false , so I > have checked termios.c , but I need some help how to correct it, because > it fails on function WriteFile(). > > Another problem is that after this exception I try to close serial port, > but it is deadlocked. > So my question is How to recover from it? > Hi Lubo RXTX will deadlock if you close from an event listener. This is a known problem. Is that where you are trying to close the port? Closing from an event listener needs to be gone through by someone with time to look at the native clode locking out the java code. I dont have any ideas concerning your card in powersavings mode. It sounds like the WriteFile is failing. If you would like to try building rxtx for windows with some of your changes to termios.c to try to find out more or try to handle the condition, I can set you up with an account off the mail list that builds rxtx easily. -- Trent Jarvi taj at www.linux.org.uk From mark at panonet.net Fri Apr 29 03:25:42 2005 From: mark at panonet.net (Mark Anderson) Date: Fri, 29 Apr 2005 10:25:42 +0100 Subject: [Rxtx] EINTR issue with CNI In-Reply-To: References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> Message-ID: <200504291025.42742.mark@panonet.net> On Wednesday 27 April 2005 21:18, Trent Jarvi wrote: > On Wed, 27 Apr 2005, Mark Anderson wrote: > > On Monday 25 April 2005 22:41, Trent Jarvi wrote: > > > On Mon, 25 Apr 2005, Mark Anderson wrote: > > > > I am running the CNI code with GCJ and I am seeing an EINTR signal > > > > sometimes interrupt the SELECT call in read_byte_array, causing an > > > > IOException. > > > > > > > > Is there a way to ignore EINTR for SELECT? I tried using the same if > > > > statement as is used to ignore EINTR for the READ call but this just > > > > caused an EOFException. > > > > > > Assuming this is Linux, the only thing you can do on EINTR is restart > > > the select() as you suggest you are trying. I'm curious about the > > > EOFException as that is not comming from rxtx. > > > > > > I'm not sure what EOFException means in this context. Something > > > recieved control-D? The read failed? read returned 0 bytes (timed > > > out)? > > > > > > If you have made any minor fixes with the CNI code, please do share > > > them with the list and I'll put them in. I know that code is a bit > > > stale as I just did it out of courisity at the time. > > > > OK here is a patch that has solved the problem for me. > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > seems to interrupt the SELECT call if that is happening when GC occurs. > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > SELECT. > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we need to block that too. Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: SerialImp.patch Type: text/x-diff Size: 733 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20050429/d72e693b/attachment-0012.bin From taj at www.linux.org.uk Fri Apr 29 05:54:58 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 12:54:58 +0100 (BST) Subject: [Rxtx] EINTR issue with CNI In-Reply-To: <200504291025.42742.mark@panonet.net> References: <200504251747.29240.mark@panonet.net> <200504270939.58715.mark@panonet.net> <200504291025.42742.mark@panonet.net> Message-ID: On Fri, 29 Apr 2005, Mark Anderson wrote: > > > OK here is a patch that has solved the problem for me. > > > > > > The garbage collector in GCJ uses the SIGPWR signal internally but this > > > seems to interrupt the SELECT call if that is happening when GC occurs. > > > So my patch uses sigprocmask to block SIGPWR signals while we are calling > > > SELECT. > > > > Here is a further patch as the GCJ garbage collector also uses SIGXCPU so we > need to block that too. > Hi Mark This has been applied to CVS, also. Thanks. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:03:34 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:03:34 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? Message-ID: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Howdy, I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read worked. It calls the native readByte method which then calls read_byte_array and throws an IOException if the number of bytes returned is less than zero. The native read_byte_array method has a call to is_interrupted that is commented out. Why was is_interrupted there, and why is it commented out now? It looks like uncommenting the is_interrupted call and tweaking the code so that read_byte_array returns -1 if it's interrupted would let you get out of a blocking RXTXPort.read call by interrupting the thread doing the read. Is that what is_interrupted was put in for? I'm a JNI neophyte, so sorry if this is a stupid question. I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of a blocking read. Thanks in advance for shedding light on this. Sean From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Fri Apr 29 14:27:35 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Fri, 29 Apr 2005 21:27:35 +0100 (BST) Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: On Fri, 29 Apr 2005, Sean Montgomery wrote: > Howdy, > > I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read > worked. It calls the native readByte method which then calls > read_byte_array and throws an IOException if the number of bytes > returned is less than zero. The native read_byte_array method has a > call to is_interrupted that is commented out. Why was is_interrupted > there, and why is it commented out now? > > It looks like uncommenting the is_interrupted call and tweaking the > code so that read_byte_array returns -1 if it's interrupted would let > you get out of a blocking RXTXPort.read call by interrupting the thread > doing the read. Is that what is_interrupted was put in for? I'm a JNI > neophyte, so sorry if this is a stupid question. > > I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out of > a blocking read. Thanks in advance for shedding light on this. > I think it should be safe to uncomment that function call. I believe I put that in while trying to figure out a w32 crash that turned out to be a windows specific thread issue in SELECT() and nothing to do with reads. -- Trent Jarvi taj at www.linux.org.uk From sean_montgomery at baseview.com Fri Apr 29 14:30:22 2005 From: sean_montgomery at baseview.com (Sean Montgomery) Date: Fri, 29 Apr 2005 16:30:22 -0400 Subject: [Rxtx] Whys isn't is_interrupted() called in read_byte_array()? In-Reply-To: References: <878b9339fbb1ef3ea1ff3de27d927cbf@baseview.com> Message-ID: Thanks Trent, I appreciate the info. I'll experiment and let you know how things work out. Sean On Apr 29, 2005, at 4:27 PM, Trent Jarvi wrote: > On Fri, 29 Apr 2005, Sean Montgomery wrote: > >> Howdy, >> >> I was looking at the rxtx-2.0-7pre2 source to see how RXTXPort.read >> worked. It calls the native readByte method which then calls >> read_byte_array and throws an IOException if the number of bytes >> returned is less than zero. The native read_byte_array method has a >> call to is_interrupted that is commented out. Why was is_interrupted >> there, and why is it commented out now? >> >> It looks like uncommenting the is_interrupted call and tweaking the >> code so that read_byte_array returns -1 if it's interrupted would let >> you get out of a blocking RXTXPort.read call by interrupting the >> thread >> doing the read. Is that what is_interrupted was put in for? I'm a >> JNI >> neophyte, so sorry if this is a stupid question. >> >> I'm hoping to use RXTX on OS X, and I'd like to interrupt my way out >> of >> a blocking read. Thanks in advance for shedding light on this. >> > > I think it should be safe to uncomment that function call. I believe I > put that in while trying to figure out a w32 crash that turned out to > be a > windows specific thread issue in SELECT() and nothing to do with > reads. > > -- > Trent Jarvi > taj at www.linux.org.uk > _______________________________________________ > Rxtx mailing list > Rxtx at mail.linuxgrrls.org > http://mail.linuxgrrls.org/mailman/listinfo/rxtx > From taj at www.linux.org.uk Sat Apr 2 14:14:32 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 22:14:32 +0100 (BST) Subject: [Rxtx] Test Post (fwd) Message-ID: Third Try Second Try -- Trent Jarvi taj at www.linux.org.uk ---------- Forwarded message ---------- Date: Sat, 2 Apr 2005 12:45:07 +0100 (BST) From: Trent Jarvi To: Java RXTX discussion Subject: Test Post We have been fixing some issues with the mail-list including the web interface and DNS issues. If everything is working, this post should go through. -- Trent Jarvi taj at www.linux.org.uk From bultza at sondasespaciales.com Sat Apr 2 14:50:14 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sat, 02 Apr 2005 23:50:14 +0200 Subject: [Rxtx] Using BUSI2C with rxtx Message-ID: <424F1396.3070003@sondasespaciales.com> Im happy to see that the list starts to work at least!! Hi everybody, my name is Bultza, I'm new in this list. I work in Linux and I'm developing a proyect to control a Telescope from Internet and with a Wireless connection. The telescope is controled by an old computer with a small program that I have written in java, this computer has 2 serial ports. One of them I use it for wireless comunications, for that I have developed a small API in java, and the hardware for the wireless. This seems to work... Now I have found a big problem, I want to use the second serial port to control some PICS which will control each motor and other things, like cameras. I have 2 different solutions: 1? Use a bus I2C. 2? Use serial port as usual, and use the digital outsignals of the serial port to select each pic who I want to comunicate with. I wanted to use the bus I2C, for the pics I thing that I will not have any problem, but with java I dont know how to start, I have been shiping around Internet for 2 days and I found almost nothing in java with BUS I2C, the rxtx API seems to have some classes for the I2C, but are private, I can declare nothing. Any ideas of how can I start or where can I get information or a tutorial for using I2C with java? Any idea It will be a great help for me PD: Sorry for my english bultza From taj at www.linux.org.uk Sat Apr 2 15:15:33 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sat, 2 Apr 2005 23:15:33 +0100 (BST) Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F1396.3070003@sondasespaciales.com> References: <424F1396.3070003@sondasespaciales.com> Message-ID: On Sat, 2 Apr 2005, Aitor Conde wrote: > Im happy to see that the list starts to work at least!! > > Hi everybody, my name is Bultza, I'm new in this list. > > I work in Linux and I'm developing a proyect to control a Telescope from > Internet and with a Wireless connection. The telescope is controled by > an old computer with a small program that I have written in java, this > computer has 2 serial ports. One of them I use it for wireless > comunications, for that I have developed a small API in java, and the > hardware for the wireless. This seems to work... > > Now I have found a big problem, I want to use the second serial port to > control some PICS which will control each motor and other things, like > cameras. I have 2 different solutions: > 1? Use a bus I2C. > 2? Use serial port as usual, and use the digital outsignals of the > serial port to select each pic who I want to comunicate with. > > I wanted to use the bus I2C, for the pics I thing that I will not have > any problem, but with java I dont know how to start, I have been shiping > around Internet for 2 days and I found almost nothing in java with BUS > I2C, the rxtx API seems to have some classes for the I2C, but are > private, I can declare nothing. > > Any ideas of how can I start or where can I get information or a > tutorial for using I2C with java? > > Any idea It will be a great help for me > Hello bultza The I2C classes in rxtx have a very short development history. They are really just a slightly modified version of the Serial support. These classes do not open the correct devices yet and probably need work to read and write at the C level. With the RS485, Raw and I2C classes in rxtx, I think I did those all in a lazy afternoon the same way. So We dont really have a tutorial or a working set of classes at this point. The classes need to be 'turned on' in RXTXCommPort.java which is fairly easy, but from there we have to figure out what the device names are for starters. I have not looked into I2C in detail. For instance, it may be required to address indidual devices on the I2C bus. I'm not sure how that is done yet. We can certainly help you some but I just want you to know the state before you make a decision. There is low level coding that I assume needs to be done. It would probably take a fair amount of effort to get to the point where your telescope is working with I2C. Perhaps this is one area rxtx could do in the future. I put the RS485 in there and later figured out it was a bad idea after learning more about it. Maybe we could explore I2C more. Especially for hobby use. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Sat Apr 2 15:55:55 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sat, 02 Apr 2005 23:55:55 +0100 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424F22FB.7050204@emation.pt> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050402/648ff492/attachment-0045.html From bultza at sondasespaciales.com Sun Apr 3 01:52:17 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 10:52:17 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: References: <424F1396.3070003@sondasespaciales.com> Message-ID: <424FAEC1.5030006@sondasespaciales.com> Oh thanks for the response!! I was thinking about it, and I think I would like to help in everything to bring the rxtx work with the I2C, but the proyect Im doing is for my career and I have to develop the I2C in 1 week time!! (I must finish the proyect in 1 month), and i'm so so tired after having done the wireless, hehe I'm sure that you understand what I mean ;), developing the rxtx have to be a lot of times very very tiring for sure! The proyect Im doing now is a madness race but I want to finish it this summer and put somewhere in Internet so people could use it for their telescopes. For that maybe I will be again with the necesary stregth to help everything you want in the I2C if you are interested yet, but now I have so many work for the next 2 months... (one for developing and one for documentation) So I think now I will use the digital signal of DTR an RTS to control demultiplexors, and directly connect each demultiplexor to each RX TX in each pic, with those 2 signals I can redirect 4 directions that is just what I need, (3 for motors, and one for a forecast center), but I perfectly now that this is like untidy and It is not a scalable solution, It is for this reason Im still interested in using I2C in the future. Really thanks for the response, and hoping to help in the future Bultza Trent Jarvi wrote: >On Sat, 2 Apr 2005, Aitor Conde wrote: > > > >>Im happy to see that the list starts to work at least!! >> >>Hi everybody, my name is Bultza, I'm new in this list. >> >>I work in Linux and I'm developing a proyect to control a Telescope from >>Internet and with a Wireless connection. The telescope is controled by >>an old computer with a small program that I have written in java, this >>computer has 2 serial ports. One of them I use it for wireless >>comunications, for that I have developed a small API in java, and the >>hardware for the wireless. This seems to work... >> >>Now I have found a big problem, I want to use the second serial port to >>control some PICS which will control each motor and other things, like >>cameras. I have 2 different solutions: >>1? Use a bus I2C. >>2? Use serial port as usual, and use the digital outsignals of the >>serial port to select each pic who I want to comunicate with. >> >>I wanted to use the bus I2C, for the pics I thing that I will not have >>any problem, but with java I dont know how to start, I have been shiping >>around Internet for 2 days and I found almost nothing in java with BUS >>I2C, the rxtx API seems to have some classes for the I2C, but are >>private, I can declare nothing. >> >>Any ideas of how can I start or where can I get information or a >>tutorial for using I2C with java? >> >>Any idea It will be a great help for me >> >> >> > >Hello bultza > >The I2C classes in rxtx have a very short development history. They are >really just a slightly modified version of the Serial support. > >These classes do not open the correct devices yet and probably need work >to read and write at the C level. With the RS485, Raw and I2C classes in >rxtx, I think I did those all in a lazy afternoon the same way. > >So We dont really have a tutorial or a working set of classes at this >point. The classes need to be 'turned on' in RXTXCommPort.java which is >fairly easy, but from there we have to figure out what the device names >are for starters. > >I have not looked into I2C in detail. For instance, it may be required to >address indidual devices on the I2C bus. I'm not sure how that is done >yet. > >We can certainly help you some but I just want you to know the state >before you make a decision. There is low level coding that I assume needs >to be done. It would probably take a fair amount of effort to get to the >point where your telescope is working with I2C. > >Perhaps this is one area rxtx could do in the future. I put the RS485 in >there and later figured out it was a bad idea after learning more about >it. Maybe we could explore I2C more. Especially for hobby use. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20050403/affd286e/attachment-0045.html From bultza at sondasespaciales.com Sun Apr 3 03:12:53 2005 From: bultza at sondasespaciales.com (Aitor Conde) Date: Sun, 03 Apr 2005 11:12:53 +0200 Subject: [Rxtx] Using BUSI2C with rxtx In-Reply-To: <424F22FB.7050204@emation.pt> References: <424F1396.3070003@sondasespaciales.com> <424F22FB.7050204@emation.pt> Message-ID: <424FB395.20203@sondasespaciales.com> Hi Ricardo! I would like to work with a high level development, but the pics are just pics and for that I must use the lowest levels (I think that It was what you mean). And also, I think that working in the lowest level is something tedious but brilliant and beautiful, is like you now everything you do because you must develop everything, hehe, yeah I'm terrible mad, thats the reason I have made my own wifi cards and use the rxtx to use them, hahaha my own 811rxtx, with the incredible velocity of downloading a photograpy of 17,5kb in 20 seconds xDDD Its like you feel so proud when you see it works hehe (my firsts downloads where a 17,5kb in just 3 minutes hehehehe terrible!!!, I know) And the page you have show me is really interesting, but Im not going to pay 90$ for that!!! you now, i think that hardware should cost about 10$ or less, and the firmware 80$!!!!!!!!, I would prefer to do it my self and lose 2 weeks making my own firmware, ok 80$ or two weeks of my life? difficult question, but no, I have better solutions than this! Anyway thank you for this, because I didnt thougth in this solution, I think I was complety bloked searching for someone using rxtx and I2C. The small devices with java (such as mobile phones and similar) seems to have developed the I2C for comunications with other machines by serial devices. :) Bultza Ricardo Trindade wrote: > Hi, > > If you can, do yourself a favor and buy a converter from I2C to > something better supporting at a high level development. > > If found this http://www.emicros.com/i2c232.htm, don't know if it > will work, but took me about 10 seconds to find, so perhaps there is > event something that does I2C to IP, which should allow 100% pure > java. Don't get me wrong, I like rxtx and use it, but if you stay away > from low level stuff you'll be a happier gui :) > > regards, > Ricardo > > Trent Jarvi wrote: > >>On Sat, 2 Apr 2005, Aitor Conde wrote: >> >> >> >>>Im happy to see that the list starts to work at least!! >>> >>>Hi everybody, my name is Bultza, I'm new in this list. >>> >>>I work in Linux and I'm developing a proyect to control a Telescope from >>>Internet and with a Wireless connection. The telescope is controled by >>>an old computer with a small program that I have written in java, this >>>computer has 2 serial ports. One of them I use it for wireless >>>comunications, for that I have developed a small API in java, and the >>>hardware for the wireless. This seems to work... >>> >>>Now I have found a big problem, I want to use the second serial port to >>>control some PICS which will control each motor and other things, like >>>cameras. I have 2 different solutions: >>>1? Use a bus I2C. >>>2? Use serial port as usual, and use the digital outsignals of the >>>serial port to select each pic who I want to comunicate with. >>> >>>I wanted to use the bus I2C, for the pics I thing that I will not have >>>any problem, but with java I dont know how to start, I have been shiping >>>around Internet for 2 days and I found almost nothing in java with BUS >>>I2C, the rxtx API seems to have some classes for the I2C, but are >>>private, I can declare nothing. >>> >>>Any ideas of how can I start or where can I get information or a >>>tutorial for using I2C with java? >>> >>>Any idea It will be a great help for me >>> >>> >>> >> >>Hello bultza >> >>The I2C classes in rxtx have a very short development history. They are >>really just a slightly modified version of the Serial support. >> >>These classes do not open the correct devices yet and probably need work >>to read and write at the C level. With the RS485, Raw and I2C classes in >>rxtx, I think I did those all in a lazy afternoon the same way. >> >>So We dont really have a tutorial or a working set of classes at this >>point. The classes need to be 'turned on' in RXTXCommPort.java which is >>fairly easy, but from there we have to figure out what the device names >>are for starters. >> >>I have not looked into I2C in detail. For instance, it may be required to >>address indidual devices on the I2C bus. I'm not sure how that is done >>yet. >> >>We can certainly help you some but I just want you to know the state >>before you make a decision. There is low level coding that I assume needs >>to be done. It would probably take a fair amount of effort to get to the >>point where your telescope is working with I2C. >> >>Perhaps this is one area rxtx could do in the future. I put the RS485 in >>there and later figured out it was a bad idea after learning more about >>it. Maybe we could explore I2C more. Especially for hobby use. >> >> >> > >------------------------------------------------------------------------ > >_______________________________________________ >Rxtx mailing list >Rxtx at mail.linuxgrrls.org >http://mail.linuxgrrls.org/mailman/listinfo/rxtx > > -- Aitor Conde Administrador de www.sondasespaciales.com Sondas Espaciales. Descubre el Sistema Solar From ricardo.trindade at emation.pt Sun Apr 3 13:42:59 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Sun, 03 Apr 2005 20:42:59 +0100 Subject: [Rxtx] reading .dll or .so from classpath Message-ID: <42504743.1060304@emation.pt> Hi, Some time ago it a patch was discussed on the mailing list to allow the loading of the .so or .dll from the classpath, instead of from the system lib directory. Is this already possible with current RXTX ? thanks Ricardo From taj at www.linux.org.uk Sun Apr 3 15:59:15 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 3 Apr 2005 22:59:15 +0100 (BST) Subject: [Rxtx] reading .dll or .so from classpath In-Reply-To: <42504743.1060304@emation.pt> References: <42504743.1060304@emation.pt> Message-ID: On Sun, 3 Apr 2005, Ricardo Trindade wrote: > Hi, > > Some time ago it a patch was discussed on the mailing list to allow > the loading of the .so or .dll from the classpath, instead of from the > system lib directory. > > Is this already possible with current RXTX ? > I have been _very_ slow to take patches like this. The other related issue is installing rxtx from applets. I look at these as someone who was once younger and thought hacking was breaking. I dont ever want to see rxtx as a cracker tool. What we are reeally talking about is bypassing Java security. I understand the good intentions but you have to look at the entire picture here. The right solution is to have rxtx distributed by your favorite java vendor. I wont complain, we wont charge a cent. There is no bomb here as long as source is shared. This is a java vendor problem not an RXTX problem. -- Trent Jarvi taj at www.linux.org.uk From ricardo.trindade at emation.pt Mon Apr 4 09:17:23 2005 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 04 Apr 2005 16:17:23 +0100 Subject: [Rxtx] UnsupportedClassVersion on latest snapshot Message-ID: <42515A83.4050907@emation.pt> Hi, I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most recent stable snapshot), and get the following exception : It looks like rxtx has been compiled with jdk 1.5. If this was indeed the case, I think there is a compilation flag that generates code that runs on older jdks. java.lang.UnsupportedClassVersionError: gnu/io/UnsupportedCommOperationException (Unsupported major.minor version 49.0) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:539) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) I'm trying to run it with 1.4. thanks Ricardo From taj at www.linux.org.uk Tue Apr 5 00:48:12 2005 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue, 5 Apr 2005 07:48:12 +0100 (BST) Subject: [Rxtx] UnsupportedClassVersion on latest snapshot In-Reply-To: <42515A83.4050907@emation.pt> References: <42515A83.4050907@emation.pt> Message-ID: On Mon, 4 Apr 2005, Ricardo Trindade wrote: > Hi, > > I'm using rxtx-2.1-CVS-20050120-bins (which looks like the most > recent stable snapshot), and get the following exception : > > It looks like rxtx has been compiled with jdk 1.5. If this was > indeed the case, I think there is a compilation flag that generates code > that runs on older jdks. > > java.lang.UnsupportedClassVersionError: > gnu/io/UnsupportedCommOperationException (Unsupported major.minor > version 49.0) [snip] Thanks Ricardo I recompiled the jar with javac -source 1.3 -target 1.3. That should cover most of the JRE's in use today. I also compiled the rxtx 2.0 x86_64 native library which appeared to be missing. I tried looking for fl